package ru.niir.goodfil;

import ru.niir.goodfil.audit.util.XMLUtils;
import ru.niir.goodfil.db.Order;
import ru.niir.goodfil.db.handlers.Goodfil;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author ksazonov
 */
public class Application {
    public static void main(String[] args) throws IOException {
        Goodfil gf = new Goodfil();
        Order o1 = gf.getOrderById(6100);
        Order o2 = gf.getOrderById(6110);

        String xml1 = XMLUtils.getObjectXml(o1);
        String xml2 = XMLUtils.getObjectChangeXml(o1, o2);

        FileWriter fw1 = new FileWriter("C:\\test1.Order.xml");
        fw1.write(xml1);
        fw1.close();

        FileWriter fw2 = new FileWriter("c:\\test2.Order.xml");
        fw2.write(xml2);
        fw2.close();

    }
}
